/*    */ package com.lmpop.createIndex.search;
/*    */ 
/*    */ import com.lmpop.createIndex.searchModel.Queue;
/*    */ import com.lmpop.createIndex.searchModel.QueueValue;
/*    */ import com.lmpop.createIndex.searchModel.SearchData;
/*    */ import com.lmpop.createIndex.searchModel.SearchModel;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintStream;
/*    */ import java.util.ArrayList;
/*    */ import java.util.Hashtable;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class MenuInfoIndexFiles
/*    */ {
/*    */   public ProperUtil properUtil;
/*    */   private String file_path;
/*    */ 
/*    */   public MenuInfoIndexFiles()
/*    */   {
/* 21 */     this.properUtil = new ProperUtil();
/* 22 */     this.file_path = this.properUtil.getFilePathByModel("menuinfo");
/*    */   }
/*    */ 
/*    */   public String getMenuNameById(String menu_id) throws IOException {
/* 26 */     SearchData search = new SearchData();
/* 27 */     ArrayList paraList = new ArrayList();
/* 28 */     paraList.add(new SearchModel("0", "menu_id", menu_id));
/* 29 */     ArrayList list = search.getSearchInfo(this.file_path, paraList);
/* 30 */     String menu_name = "";
/* 31 */     Hashtable infoMap = new Hashtable();
/* 32 */     if ((list != null) && (list.size() > 0)) infoMap = (Hashtable)list.get(0);
/* 33 */     if (infoMap.get("menu_name") != null) menu_name = infoMap.get("menu_name").toString();
/* 34 */     return menu_name;
/*    */   }
/*    */ 
/*    */   public String getMenuRemark(String menu_id) throws IOException {
/* 38 */     SearchData search = new SearchData();
/* 39 */     ArrayList paraList = new ArrayList();
/* 40 */     paraList.add(new SearchModel("0", "menu_id", menu_id));
/* 41 */     ArrayList list = search.getSearchInfo(this.file_path, paraList);
/* 42 */     String remark = "";
/* 43 */     Hashtable infoMap = new Hashtable();
/* 44 */     if ((list != null) && (list.size() > 0)) infoMap = (Hashtable)list.get(0);
/* 45 */     if (infoMap.get("remark") != null) remark = infoMap.get("remark").toString();
/* 46 */     return remark;
/*    */   }
/*    */ 
/*    */   public List getMenuInfo(Map paraMap) throws IOException {
/* 50 */     ArrayList showList = new ArrayList();
/* 51 */     SearchData search = new SearchData();
/* 52 */     ArrayList paraList = new ArrayList();
/*    */ 
/* 54 */     String menu_id = ""; String subsys_code = ""; String menu_name = ""; String cust_id = ""; String up_menu_id = ""; String menu_class = ""; String remove_tag = "1";
/* 55 */     if (paraMap.get("menu_id") != null) menu_id = paraMap.get("menu_id").toString();
/* 56 */     if (paraMap.get("subsys_code") != null) subsys_code = paraMap.get("subsys_code").toString();
/* 57 */     if (paraMap.get("menu_name") != null) menu_name = paraMap.get("menu_name").toString();
/* 58 */     if (paraMap.get("cust_id") != null) cust_id = paraMap.get("cust_id").toString();
/* 59 */     if (paraMap.get("up_menu_id") != null) up_menu_id = paraMap.get("up_menu_id").toString();
/* 60 */     if (paraMap.get("menu_class") != null) menu_class = paraMap.get("menu_class").toString();
/* 61 */     if (paraMap.get("remove_tag") != null) remove_tag = paraMap.get("remove_tag").toString();
/* 62 */     Queue queue = new Queue(new QueueValue[] { new QueueValue("menu_name", 2, true) });
/* 63 */     paraList.add(new SearchModel("0", "cust_id", cust_id));
/* 64 */     paraList.add(new SearchModel("0", "remove_tag", remove_tag));
/* 65 */     paraList.add(new SearchModel("0", "menu_id", menu_id));
/* 66 */     paraList.add(new SearchModel("0", "subsys_code", subsys_code));
/* 67 */     paraList.add(new SearchModel("0", "up_menu_id", up_menu_id));
/* 68 */     paraList.add(new SearchModel("0", "menu_class", menu_class));
/* 69 */     paraList.add(new SearchModel("2", menu_name, new String[] { "menu_name", "rsrv_str1" }));
/* 70 */     showList = search.getSearchInfo(this.file_path, paraList, queue);
/*    */ 
/* 73 */     return showList;
/*    */   }
/*    */ 
/*    */   public ArrayList filterMenuList(String cust_id, ArrayList infoList)
/*    */   {
/* 78 */     if (infoList == null) return null;
/* 79 */     if (cust_id.equals("")) return infoList;
/* 80 */     ArrayList thisList = new ArrayList();
/* 81 */     Hashtable sMap = new Hashtable();
/* 82 */     for (int i = 0; i < infoList.size(); i++) {
/* 83 */       sMap = (Hashtable)infoList.get(i);
/* 84 */       System.out.println("--" + sMap);
/* 85 */       String key = "";
/* 86 */       if (sMap.get("cust_id") != null) key = sMap.get("cust_id").toString().trim();
/* 87 */       if ((!key.equals("")) && (key.equals(cust_id))) {
/* 88 */         thisList.add(sMap);
/*    */       }
/*    */     }
/* 91 */     if (infoList != null) infoList.clear();
/* 92 */     infoList = null;
/* 93 */     return thisList;
/*    */   }
/*    */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.createIndex.search.MenuInfoIndexFiles
 * JD-Core Version:    0.6.0
 */